<?php
require_once(dirname(__FILE__).'/../bootstrap/Doctrine.php');

$t = new lime_test(5, new lime_output_color());

$t->comment('->getContentHtml()');
$todo = new Todo();
$todo->content = 'lorem ipsum';
$t->is(substr($todo->content_html, 0, 18), '<p>lorem ipsum</p>', '->getContentHtml() returns the html version of the content (Markdown)');

$t->comment('->getTagClasses()');
$todo = Doctrine::getTable('Todo')->findOneByTitle('Customise the "Oops! Page Not Found" page');
$t->is($todo->tag_classes, 'high design', '->getTagClasses() returns the related tag names seperated by spaces');
$todo = new Todo();
$t->is($todo->tag_classes, '', '->getTagClasses() returns an empty string when the todo has no tag');

$t->comment('->publish()');
$todo = Doctrine::getTable('Todo')->findOneByTitle('Initially, this todo was not published');
$todo->publish();
$t->is($todo->is_published, true, '->publish() publish the todo and save it');

$t->comment('->unpublish()');
$todo->unpublish();
$t->is($todo->is_published, false, '->unpublish() un-publish the todo and save it');